<%@ Page PathInChannel="agent/order/view/{ID}{Ext}" RunAt="Execute" %>
<%
if (Manager.User == null || Convert.ToString(Order.Rows[0][AliCMS.CourseModule.Alias.Order.DistributerID]) != Manager.User["ID"])
{
	Response.Redirect(<%=BuildUrl("user/index")%>);
}
%>
<!doctype html>
<html lang="<%=PageLang%>"<%If PageLang == "UYG"%> class="rtl"<%EndIf%>>
<head>
<ali:List ID="Order" Mark="Course" Object="Order" Page="1" PageSize="1" Condition="Condition()" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<title>订单详情</title>
<link rel="stylesheet" href="<%=CommonPath%>aliui/skin/default/ali.mobile.css">
<link rel="stylesheet" href="<%=CommonSkinPath%>css/common.css">
<link rel="stylesheet" href="<%=CustomCss%>">
<script language="c#" runat="server">
protected string Condition()
{
	String id = Request.QueryString["ID"];
	if (System.Text.RegularExpressions.Regex.IsMatch(id, @"^\d+$"))
		return AliCMS.CourseModule.Alias.Order.InnerID + "=" + id;
	else
		return AliCMS.CourseModule.Alias.Order.ID + "=" + id;
}
</script>
</head>
<body>
<div class="page flex" id="member-order-view" data-id="<%=Order[InnerID]%>" data-instance-id="<%=SubInstanceID%>">
	<!-- start="标题栏" -->
	<div class="titlebar"><a class="back"></a><h1>订单详情</h1></div>
	<!-- end="标题栏" -->

	<!-- start="订单详情" -->
	<div id="member-order-view-body">
		<!-- start="基本信息" -->
		<section>
			<h1>基本信息</h1>
			<ul>
				<li><label>订单号码：</label><span><%=Order[No]%></span></li>
				<li><label>订单总价：</label><span><em><%=Convert.ToDecimal(Order[Sum]).ToString("0.00")%></em></span></li>
				<li>
					<label>代理收入：</label>
					<span>
						<em>
							<%If Convert.ToString(Order[DistributerID]) == User['ID']%>
								<%=Convert.ToDecimal(Order[AgentCommision]).ToString("0.00")%>
							<%ElseIf Convert.ToString(Order[ParentAgentID]) == User['ID']%>
								<%=Convert.ToDecimal(Order[ParentAgentCommision]).ToString("0.00")%>
							<%ElseIf Convert.ToString(Order[GrandAgentID]) == User['ID']%>
								<%=Convert.ToDecimal(Order[GrandAgentCommision]).ToString("0.00")%>
							<%EndIf%>
						</em>
					</span>
				</li>
			</ul>
		</section>
		<!-- end="基本信息" -->

		<!-- start="用户备注" -->
		<section>
			<h1>用户信息</h1>
			<ul>
				<li><label>用户名：</label><span><%=Order[UserName]%></span></li>
			</ul>
		</section>
		<!-- end="用户备注" -->

		<!-- start="商品列表" -->
		<section>
			<h1>课程信息</h1>
			<dl>
				<dt><img src="<%=Order[CourseThumbnail]%>"></dt>
				<dd><%=Order[CourseName]%></dd>
			</dl>
		</section>
		<!-- end="商品列表" -->

		<!-- start="支付信息" -->
		<section>
			<h1>支付信息</h1>
			<ul>
				<li>
					<label>是否付款：</label>
					<span>
						<%If Convert.ToInt32(Order[IsPayed]) == 0%>
							等待付款
						<%ElseIf Convert.ToInt32(Order[IsPayed]) == 1%>
							部分付款
						<%ElseIf Convert.ToInt32(Order[IsPayed]) == 2%>
							已付款
						<%ElseIf Convert.ToInt32(Order[IsPayed]) == 3%>
							部分退款
						<%ElseIf Convert.ToInt32(Order[IsPayed]) == 4%>
							已退款
						<%EndIf%>
					</span>
				</li>
				
				<%If Convert.ToInt32(Order[IsPayed]) > 0%>
					<li><label>支付时间：</label><span><%=Order[PayTime]%></span></li>
				<%EndIf%>

				<%If Convert.ToInt32(Order[IsPayed]) == 2 && Guid.Equals(Order[PaymentID], Guid.Empty)%>
					<li><label>支付方式：</label><span>余额支付</span></li>
				<%ElseIf !Guid.Equals(Order[PaymentID], Guid.Empty)%>
					<li><label>支付方式：</label><span><%=Order[PaymentName]%></span></li>
					<%If Convert.ToString(Order[PaymentType]) == "FACE_TO_FACE"%>
						<li><label>联系人：</label><span><%=Order[PaymentAccountName]%></span></li>
						<li><label>联系电话：</label><span><%=Order[PaymentAccountNo]%></span></li>
					<%Else%>
						<li><label>支付账户：</label><span><%=Order[PaymentAccountName]%></span></li>
						<li><label>支付账号：</label><span><%=Order[PaymentAccountNo]%></span></li>
					<%EndIf%>
				<%EndIf%>
				
				<%If Convert.ToInt32(Order[IsPayed]) == 4%>
					<li><label>退款时间：</label><span><%=Order[RefundTime]%></span></li>
					<li><label>退款备注：</label><span><%=Order[RefundMemo]%></span></li>
				<%EndIf%>
			</ul>
		</section>
		<!-- end="支付信息" -->

		<!-- start="发货信息" -->
		<section>
			<h1>发货信息</h1>
			<ul>
				<li>
					<label>是否发货：</label>
					<span>
						<%If Convert.ToInt32(Order[IsDelivered]) == 0%>
							等待发货
						<%ElseIf Convert.ToInt32(Order[IsDelivered]) == 1%>
							已发货
						<%ElseIf Convert.ToInt32(Order[IsDelivered]) == 2%>
							已收货
						<%ElseIf Convert.ToInt32(Order[IsDelivered]) == 3%>
							已退货
						<%EndIf%>
					</span>
				</li>
				
				<%If Convert.ToInt32(Order[IsDelivered]) > 0%>
					<li><label>发货时间：</label><span><%=Order[DeliverTime]%></span></li>
					<li><label>发货备注：</label><span><%=Order[DeliverMemo]%></span></li>
				<%EndIf%>
				
				<%If Convert.ToInt32(Order[IsDelivered]) == 3%>
					<li><label>退货时间：</label><span><%=Order[ReturnTime]%></span></li>
					<li><label>退货备注：</label><span><%=Order[ReturnMemo]%></span></li>
				<%EndIf%>
			</ul>
		</section>
		<!-- end="发货信息" -->
	</div>
	<!-- end="订单详情" -->
</div>
<script src="<%=CommonPath%>jquery/core3.js"></script>
<script src="<%=CommonPath%>aliui/ali.mobile.min.js"></script>
<script src="<%=JsPath%>common.js"></script>
</body>
</html>